package com.ymatou.iapi.livemanage.testcase;

import org.json.JSONObject;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.livemanage.service.SearchActivityCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;
import com.ymttest.utils.EnvSetup;

public class Ts_SearchActivity {
	private static String sellerId = EnvSetup.getData("productsellerid");
	private static String sellerName = EnvSetup.getData("productsellername");
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("直播Admin-查询列表");
	}

	@Before
	public void caseUp() {
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(new SearchActivityCall().getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	
	
	 @Test
	 @Category(P1.class)
	 @TestCase
	public void Tc_SearchActivity_001() {
		 Logger.start(true,"直播Admin-查询列表");
		 try{
			 SearchActivityCall searchActivityCall = new SearchActivityCall();
			 searchActivityCall.callService();
			
			 JSONObject  searchActivityBean = new JSONObject( searchActivityCall.getReturnData());
				 
			 //check
			 Logger.verifyEquals(200,searchActivityBean.getInt("Code"), "响应报文-返回码");
			 Logger.verifyEquals(true, searchActivityBean.getJSONObject("Data").getJSONArray("ActivityList").length()>0, "响应报文-ActivityList");
				
				
				
				
		 }catch (Exception e){
			 Logger.fail(e);
		 }
		 
		 
		 
		 
		 
		 
		 
		 
		 
		 
		 
		 
		 
	 }
}
